package com.by.controller;

import com.by.common.bean.ResultBean;
import com.by.common.controller.BaseController;
import com.by.service.DictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "字典管理")
@RequestMapping("/v1")
@RestController
public class DictController extends BaseController {

    @Autowired
    DictService dictService;

    @ApiOperation("字典配置")
    @GetMapping("/dict/type")
    public ResultBean queryDict(@RequestParam(name = "type", required = true) String type) {
        List list = dictService.queryDict(type);
        return success("字典配置", list);
    }
}
